package com.huluobo.high3demo.live;

import android.app.Application;
import android.util.Log;

import androidx.annotation.NonNull;
import androidx.lifecycle.MutableLiveData;

import com.huluobo.mvvm.baen.FollowLikeBeanResult;
import com.huluobo.mvvm.baen.GiftBeanResult;
import com.huluobo.mvvm.db.eneity.Money;
import com.huluobo.mvvm.viewmodel.BaseViewModel;

/**
 * Created by LC on 2023/9/21.
 */
public class LiveViewModel extends BaseViewModel<LiveRepo> {
    MutableLiveData<GiftBeanResult> giftSuccess = new MutableLiveData<>();
    MutableLiveData<String> giftFailed = new MutableLiveData<>();

    MutableLiveData<FollowLikeBeanResult> followSuccess = new MutableLiveData<>();

    MutableLiveData<String> followFailed = new MutableLiveData<>();

    MutableLiveData<Money> moneySuccess = new MutableLiveData<>();

    MutableLiveData<String> moneyFailed = new MutableLiveData<>();

    public LiveViewModel(@NonNull Application application) {
        super(application);
    }

    public void getGiftList() {
        repo.getGiftList(giftSuccess, giftFailed);
    }

    public void followAuth(String authName) {
        repo.followAuth(authName, followSuccess, followFailed);
    }

    public void queryUserMoney(String username) {
        repo.queryUserMoney(username, moneySuccess, moneyFailed);
    }

    public void updateUserMoney(Money money) {
        repo.updateUserMoney(money);
    }

    @Override
    protected LiveRepo createRepo() {
        return new LiveRepo();
    }
}
